# Contributor:Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: jane400 <alpine@j4ne.de>
pkgname=gtksourceview5
pkgver=5.10.0
pkgrel=0
pkgdesc="A text widget adding syntax highlighting and more to GNOME"
url="https://wiki.gnome.org/Projects/GtkSourceView"
arch="all"
license="GPL-2.0-or-later"
depends_dev="
	gtk4.0-dev
	libxml2-dev
	"
makedepends="$depends_dev
	gobject-introspection-dev
	libxslt
	meson
	pcre2-dev
	vala
	"
checkdepends="
	dbus
	ibus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.gnome.org/sources/gtksourceview/${pkgver%.*}/gtksourceview-$pkgver.tar.xz"
options="!check" # regex test fails
builddir="$srcdir/gtksourceview-$pkgver"

build() {
	abuild-meson \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	xvfb-run meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
c8fb377c0f65fff35fe764c98d40a399b2f3982bfb7e25512b50f4f3c31b226d4775e136fc4be682b2e44a3b643cefd01d195c9a61f5c3ca81d15bef0093e47a  gtksourceview-5.10.0.tar.xz
"
